﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Services;
using Utils.DT;


namespace GastosService
{
    /// <summary>
    /// Summary description for Service1
    /// </summary>
    [WebService(Namespace = "http://tempuri.org/")]
    [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
    [System.ComponentModel.ToolboxItem(false)]
    // To allow this Web Service to be called from script, using ASP.NET AJAX, uncomment the following line. 
    // [System.Web.Script.Services.ScriptService]
    public class WSGastos : System.Web.Services.WebService
    {

        [WebMethod(Description = "Devuelve los conceptos ordenados alfabeticamente.")]
        public List<DTConcepto> GetConceptos()
        {
            return DataLayer.PersistenciaConcepto.GetListConceptoDomain().OrderBy(x => x.Concepto).ToList<DTConcepto>();
        }

        [WebMethod(Description = "Crea un concepto nuevo.")]
        public void CrearConcepto(DTConcepto concepto)
        {
            DataLayer.PersistenciaConcepto.CrearConcepto(concepto);
        }

        [WebMethod(Description = "Elimina un concepto")]
        public void EliminarConcepto(DTConcepto concepto)
        {
            DataLayer.PersistenciaConcepto.DeleteConcepto(concepto);
        }
    }
}